package com.itheima.dao;

import org.apache.ibatis.annotations.Mapper;

import java.time.LocalDate;
import java.util.List;

@Mapper
public interface ReportDao {

    List<String> getOrederSetmealNames();

    List<Integer> getOrderSetmealCount();

    Integer getMemberOfLastyear(LocalDate date);

    //    /*总会员数*/
//    select count(*) as totalMember from health.t_member;
    Integer totalMember();

    //    /*今日新增会员*/
    Integer todayNewMember();
//    select count(*) as thisWeekNewMember from health.t_member where regTime = now();
    //    /*本周新增会员数*/
    Integer thisWeekNewMember();

    //    select count(*) as thisWeekNewMember from health.t_member where weekofyear(regTime) = weekofyear(now());
//    /*本月新增会员数*/
    Integer thisMonthNewMember();

    //    select count(*) as thisMonthNewMember from health.t_member where month(regTime) = month(now()) and year(regTime) = year(now());
//    /*今日预约数*/
    Integer todayOrderNumber();

    //    select count(*) as todayOrderNumber from health.t_order where orderDate = now();
//    /*本周预约数*/
    Integer thisWeekOrderNumber();

    //    select count(*) as thisWeekOrderNumber from health.t_order where weekofyear(orderDate) = weekofyear(now());
//    /*本月预约数*/
    Integer thisMonthOrderNumber();

    //    select count(*) as thisMonthOrderNumber from health.t_order where month(orderDate) = month(now()) and  year(orderDate) = year(now());
//    /*今日到诊数	*/
    Integer todayVisitsNumber();

    //    select count(*) as todayOrderNumber from health.t_order where orderDate = now() and orderStatus = '到诊';
//    /*本周到诊数	*/
    Integer thisWeekVisitsNumber();

    //    select count(*) as thisWeekOrderNumber from health.t_order where weekofyear(orderDate) = weekofyear(now()) and orderStatus = '到诊';
    Integer thisMonthVisitsNumber();
//    select count(*) as thisMonthOrderNumber from health.t_order where month(orderDate) = month(now()) and  year(orderDate) = year(now()) and orderStatus = '到诊';

    //#套餐排行
    List<String> getOrederSetmealNamesOrderByCount();
    List<Integer> getOrederSetmealNumberOrderByCount();
    Integer totalOrderNumber();
//    select t2.name as 'setmealNames',count(*) as 'setmealCount'
//    from health.t_order t1 inner join health.t_setmeal t2
//    on t1.setmeal_id = t2.id
//    group by t1.setmeal_id
//    order by count(*) desc
//    limit 4;


}
